Skip to content

fix: preserve structured quota failures over ACP - #78

Merged
william0wang merged 1 commit into
william0wang:mainfrom
guanbear:fix/acp-rate-limit-errors
Aug 31, 2026
Merged

fix: preserve structured quota failures over ACP#78
william0wang merged 1 commit into
william0wang:mainfrom
guanbear:fix/acp-rate-limit-errors

Conversation

@guanbear

Copy link
Copy Markdown
Contributor

Summary

  • recognize ZCode's model_rate_limited cause code while honoring an explicit context.retryable: false
  • convert non-retryable turn.failed events into an ACP RequestError instead of allowing the SDK to collapse them to a generic Internal error
  • preserve a small machine-readable error payload (code, reason, status/provider codes, retryability, and retryAfterMs) without forwarding response headers or cookies
  • add an end-to-end prompt-handler regression test based on the observed coding-plan quota failure

This deliberately leaves delayed retry scheduling to ACP clients/control planes. The bridge keeps the session resumable and provides the metadata those clients need to decide when to resume.

Closes #77

Test plan

  • ./node_modules/.bin/tsc --noEmit
  • ./node_modules/.bin/eslint .
  • ./node_modules/.bin/tsc
  • ./node_modules/.bin/vitest run — 52 files, 723 tests passed

@guanbear
guanbear force-pushed the fix/acp-rate-limit-errors branch from a893dc5 to fa04c8c Compare August 31, 2026 02:01
@guanbear

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (fcb755e) to clear the conflicts with the Ink REPL change. Kept both new TRANSIENT_CAUSE_CODES entries (invalid_model_request from upstream, model_rate_limited from this PR) and both retry-classification tests. Validation: typecheck passed; full vitest suite 794/794 passed.

@william0wang
william0wang merged commit e053b97 into william0wang:main Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve structured model_rate_limited failures across the ACP boundary

2 participants